-
-
Notifications
You must be signed in to change notification settings - Fork 19
feat(doom): Add haptic feedback to doom #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Update doom to have callbacks for when the player is damaged and when they fire a weapon * Update doom implementation to trigger different haptic effects depending on the weapon fired and the amount of damage taken Haptics are awesome, and with doom we have the actual source code so we can do some fun stuff :) Build and run `main` on Box-Emu v0 which has haptics and ensure it feels good.
|
✅Static analysis result - no issues found! ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates haptic feedback within Doom by triggering different haptic effects when the player fires a weapon or takes damage.
- Added a call in the main loop to set and play a haptic effect using the GUI's waveform.
- Implemented two new functions (R_PlayerFire and R_PlayerHurt) in doom.cpp that determine the appropriate haptic effect based on the weapon fired and damage received.
- Updated relevant header and source files to declare and invoke haptic callbacks in the prboom module.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| main/main.cpp | Added haptic effect setup and trigger call in the main loop. |
| components/gui/include/gui.hpp | Added a getter for retrieving the haptic waveform value. |
| components/doom/src/doom.cpp | Introduced functions to trigger haptic feedback on player actions. |
| components/doom/prboom/r_main.h | Declared new haptic functions; note missing implementation for one. |
| components/doom/prboom/p_pspr.c | Updated weapon fire function to trigger haptic feedback. |
| components/doom/prboom/p_inter.c | Updated damage processing to trigger haptic effects on injury. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces haptic feedback functionality to the Doom engine by adding several callbacks for various in‐game events (such as firing weapons, taking damage, and item pickups) and updating relevant documentation. Key changes include:
- Adding new haptic callback functions and integrating them with player actions in Doom (e.g. firing, getting hurt, interacting with switches).
- Minor code improvements and cleanup in shared memory, pool allocator functions, and GUI components.
- Updating the README to document the new haptic feedback features.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| main/main.cpp | Added a haptic effect trigger using the current GUI waveform setting. |
| main/cart.hpp | Removed redundant virtual specifiers on getter functions. |
| components/shared_memory/src/shared_memory.c | Fixed printf cast for current_offset_. |
| components/pool_allocator/* | Changed pool_contains function signature to take a const pointer. |
| components/msx/src/msx.cpp | Cleaned commented code and simplified control flow in key waiting logic. |
| components/gui/include/gui.hpp | Added a simple getter for the haptic waveform. |
| components/doom/src/doom.cpp | Added new enum values and functions for triggering haptic effects. |
| components/doom/prboom/* | Integrated haptic callbacks into various event handlers (weapon fire, item pickups, damage, switch usage). |
| README.md | Updated documentation to include descriptions of the new haptic feedback feature. |
Co-authored-by: Copilot <[email protected]>
Description
Motivation and Context
Haptics are awesome, and with doom we have the actual source code so we can do some fun stuff :)
How has this been tested?
Build and run
mainon Box-Emu v0 which has haptics and ensure it feels good.Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.